package com.guozinhs.auto.frame;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 组件操作类型
 *
 * @Author: GuoZi
 * @Date: 2022/1/28 17:24
 */
@Getter
@AllArgsConstructor
public enum ActType {

    /**
     * 脚本执行相关
     */
    run("启动"),
    suspend("暂停"),
    continued("继续"),
    stop("停止"),
    /**
     * 脚本计划管理
     */
    openProject("打开项目"),
    saveProject("保存项目"),
    /**
     * 节点管理
     */
    createRootState("新建根节点"),
    pasteRootState("粘贴至根节点"),
    createNextState("新建后续节点"),
    pasteNextState("粘贴至后续节点"),
    createPreCheckState("新建前置校验节点"),
    pastePreCheckState("粘贴至前置校验节点"),
    createPostCheckState("新建后置校验节点"),
    pastePostCheckState("粘贴至后置校验节点"),
    moveUp("节点上移"),
    moveDown("节点下移"),
    removeState("删除选中节点"),
    updateState("保存配置"),
    copyState("复制节点"),
    /**
     * 图片相关
     */
    updateImage("设置匹配图片"),
    clearImage("清空匹配图片"),
    getImage("复制图片到剪切板"),
    ;

    private final String desc;

    public static ActType getByName(String name) {
        for (ActType value : ActType.values()) {
            if (value.name().equals(name)) {
                return value;
            }
        }
        return null;
    }

}